﻿using Models;
using Models.DTO;
using System;
using System.Collections.Generic;
using System.Text;

namespace IBLL
{
    /// <summary>
    /// 用户表的业务逻辑层--接口
    /// </summary>
    public interface IUserInfoBLL
    {
        /// <summary>
        /// 用户登录业务逻辑
        /// </summary>
        /// <param name="account">账号</param>
        /// <param name="password">密码</param>
        /// <param name="msg">返回消息</param>
        /// <param name="userName">返回的用户名</param>
        /// <param name="userId">返回的用户Id</param>
        /// <returns></returns>
        bool Login(string account, string password, out string msg, out string userName, out string userId);

        /// <summary>
        /// 查询用户列表的方法--分页
        /// </summary>
        /// <param name="page">第几页</param>
        /// <param name="limit">每页几条数据</param>
        /// <param name="account">用户账号</param>
        /// <param name="userName">用户姓名</param>
        /// <param name="count">数据总量</param>
        /// <returns></returns>
        List<GetUserInfosDTO> GetUserInfos(int page, int limit, string account, string userName, out int count);
        /// <summary>
        /// 添加用户方法
        /// </summary>
        /// <param name="entity"></param>
        /// <param name="msg"></param>
        /// <returns></returns>
        bool CreateUserInfo(UserInfo entity, out string msg);
        /// <summary>
        /// 用户软删除方法
        /// </summary>
        /// <param name="id">被删除的用户Id</param>
        /// <returns></returns>
        bool DeleteUserInfo(string id);

        /// <summary>
        /// 批量用户软删除方法
        /// </summary>
        /// <param name="ids">被删除的用户Id集合</param>
        /// <returns></returns>
        bool DeleteUserInfo(List<string> ids);

        /// <summary>
        /// 更新用户信息方法
        /// </summary>
        /// <param name="userInfo">要更新的实体</param>
        /// <param name="msg">返回的描述信息</param>
        /// <returns></returns>
        bool UpdateUserInfo(UserInfo userInfo, out string msg);
        /// <summary>
        /// 根据用户id获取用户信息
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        GetUserInfosDTO GetUserInfoById(string id);
        /// <summary>
        /// 更新用户信息
        /// </summary>
        /// <param name="id">用户id</param>
        /// <param name="oldPwd">旧密码</param>
        /// <param name="newPwd">新密码</param>
        /// <param name="againPwd">确认密码</param>
        /// <param name="msg">返回的消息</param>
        /// <returns></returns>
        bool UpdateUserPwd(string id, string oldPwd, string newPwd, string againPwd, out string msg);

        /// <summary>
        /// 查询用户列表的方法
        /// </summary>
        List<GetUserInfosDTO> GetUserInfos();
        /// <summary>
        /// 查询用户列表的方法
        /// </summary>
        List<GetUserInfosDTO> GetUsers(string account, string userName, out int count);
    }
}
